<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Vue计算属性</title>
	<script type="text/javascript" src="js/vue.js"></script>
</head>
<body>
	<div class="container">
		<!-- {{msg.split(' ').reverse().join(' ')}} -->
		{{msg1}}
		<button @click="change">修改</button>
	</div>
	<script type="text/javascript">
		var vm = new Vue({
					el:'.container',
					data:{
						msg:'hello vue !'
					},
					computed:{
						msg1(){
							return this.msg.split(' ').reverse().join(' ');
						}
					},
					methods:{
						change(){
							this.msg='i love vue';
						}
					}
				});
	</script>
	
</body>
</html>